package Filters;

import FilesManagers.CantOpenFileException;

public class FullFilter extends Filter{
	
	private HtmlCleaner miHtmlCleaner;
	private StopWordsCleaner limpiadorStopWords;
	private Stemming stemming;
	private CharacterUnifier unificadorCaracteres;
	
	public FullFilter (String bibliotecaStopWords, String bibliotecaStemming) throws CantOpenFileException{
		miHtmlCleaner = new HtmlCleaner();
		limpiadorStopWords = new StopWordsCleaner(bibliotecaStopWords);
		stemming = new Stemming(bibliotecaStemming);
		unificadorCaracteres = new CharacterUnifier();
	}
	public FullFilter() throws CantOpenFileException{
		this("stopwords.conf","stemming.conf");
		
	}
	
	
	
	public String procesarLinea(String linea) {
		 
		
		linea = miHtmlCleaner.procesarLinea(linea);

		linea = this.procesarLineaSinHtml(linea);
		
		return linea;
	}
	public String procesarLineaSinHtml(String linea ){
		linea = unificadorCaracteres.procesarLinea(linea);
		linea = limpiadorStopWords.procesarLinea(linea);
		linea = stemming.procesarLinea(linea);
		
		return linea;
		
	}

}
